home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1999 April / Cd Pc Users extra 19 abril 1999.iso / Prog / Inst / Scribble / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-02-23  |  1.5 KB  |  51 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   4680
  11.    StartUpPosition =   3  'Windows Default
  12. Attribute VB_Name = "Form1"
  13. Attribute VB_GlobalNameSpace = False
  14. Attribute VB_Creatable = False
  15. Attribute VB_PredeclaredId = True
  16. Attribute VB_Exposed = False
  17. Option Explicit
  18. Private PointX() As Single
  19. Private PointY() As Single
  20. Private NumPoints As Integer
  21. Private Drawing As Boolean
  22. Private Sub Form_Load()
  23.     AutoRedraw = True
  24. End Sub
  25. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  26.     ' Let MouseMove know we are drawing.
  27.     Drawing = True
  28.     ' Start from scratch
  29.     NumPoints = 0
  30.     Cls
  31.     ' Start drawing here.
  32.     CurrentX = X
  33.     CurrentY = Y
  34. End Sub
  35. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  36.     ' Make sure we are drawing.
  37.     If Not Drawing Then Exit Sub
  38.     ' Save the new point.
  39.     NumPoints = NumPoints + 1
  40.     ReDim Preserve PointX(1 To NumPoints)
  41.     ReDim Preserve PointY(1 To NumPoints)
  42.     PointX(NumPoints) = X
  43.     PointX(NumPoints) = X
  44.     ' Draw to the point.
  45.     Line -(X, Y)
  46. End Sub
  47. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  48.     ' Stop drawing.
  49.     Drawing = False
  50. End Sub
  51.